package teacher.action;

import java.util.List;

import leader.bean.MidTable;
import leader.service.MidteaexpService;

import com.opensymphony.xwork2.ActionSupport;
import teacher.service.teacher;
import teacher.bean.Expertclass;
import teacher.bean.Teacher;

public class addExp extends ActionSupport{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List<Expertclass> exp;
	private List<MidTable> midtable;
	private String teaUser;
	
	public String getTeaUser() {
		return teaUser;
	}

	public void setTeaUser(String teaUser) {
		this.teaUser = teaUser;
	}

	public List<MidTable> getMidtable() {
		return midtable;
	}

	public void setMidtable(List<MidTable> midtable) {
		this.midtable = midtable;
	}

	public List<Expertclass> getExp() {
		return exp;
	}

	public void setExp(List<Expertclass> exp) {
		this.exp = exp;
	}

	public String execute() throws Exception{
		
		exp=new teacher().selectAllExpertclass();
		Teacher t1=new Teacher(); 
		Teacher t2=new Teacher();
		t1.setUser(teaUser);
		t2=new teacher().SelectTeacher(t1);
		
		MidteaexpService mid = new MidteaexpService();
		if(mid.getAllExpById(t2).size() > 0) {
			midtable = mid.getAllExpById(t2);
		}
		
		return SUCCESS;
	}

}
